import time

import requests

from config import BASE_URL, HEADERS


class CpLoginApi:
    # 登录方法
    @classmethod
    def login(cls, json_data):
        url= BASE_URL+ "login"
        resp = requests.post(url=url, data=json_data)
        if resp.json()['code']==200:
            HEADERS['Authorization']=resp.json()['Authorization']
        return resp  #返回的目的是做断言